package com.aishua.fire.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aishua.fire.common.IdUtil;
import com.aishua.fire.entity.schedule.SchedulePlanInfo;
import com.aishua.fire.jpa.entity.ScheduleAddress;
import com.aishua.fire.mapper.SchedulePlanMapper;
import com.aishua.fire.service.ScheduleService;

@Service
public class ScheduleServiceImpl implements ScheduleService {

	@Autowired
	private SchedulePlanMapper schedulePlanMapper;
	
	@Autowired
	private IdUtil idUtil;
	
	@Override
	public void addSchedulePlan(SchedulePlanInfo schedulePlanInfo) {
		if(schedulePlanInfo.getAddressId() == null) {
			/*ScheduleAddress scheduleAddress = new ScheduleAddress();
			String addressId = idUtil.getAddrId();
			scheduleAddress.setAddressId(addressId);
//			scheduleAddress.setCreateDate(new Date());
			scheduleAddress.setScheduleAddress(schedulePlanInfo.getScheduleAddress());
			
			schedulePlanMapper.addScheduleAddress(scheduleAddress);
			
			schedulePlanInfo.setAddressId(addressId);*/
		}
		// 添加行程计划接口
		schedulePlanMapper.addSchedulePlan(schedulePlanInfo);
	}

}
